import { appPort } from "./config/appSetting.js";
import Koa from "koa";
import { usecontrollers } from "./controllers/index.js";
import { sync } from "./db/index.js";
import cors from '@koa/cors';


await sync()
let app = new Koa();
app.use(cors({ origin: 'http://511.huyingying.top' }));


app.use(async (ctx,next) => {
    await next();
});

usecontrollers(app);
app.listen(appPort);


console.log(`http://511.huyingying.top:${appPort}`);
